package com.shop.board.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.shop.board.domain.ShopBoardCommand;

public class ShopBoardDeleteValidator implements Validator{

	@Override
	public boolean supports(Class<?> clazz) {
		
		return ShopBoardCommand.class.isAssignableFrom(clazz);
	}

	@Override
	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "sb_passwd", "required");
	}
	
}
